package com.bang.thread;

/*
  @author: 13813
  @date: 2024/11/25 14:06
*/
public class TheadTest01 {
    public static void main(String[] args) throws InterruptedException {
        //线程对象
        Thread t01 = new ThreadDemo01("张三");
        t01.start();//线程开启 Thread-0

        Thread t02 = new ThreadDemo01("李四");
        t02.start();// Thread-1

        Thread t03 = new ThreadDemo01("王五");
        t03.start();// Thread-2

        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + " :" + i);
        }

        Thread thread = new Thread()
        {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    System.out.println(Thread.currentThread().getName() + " :" + i);
                }
            }
        };
        thread.start();
    }
}
